
const storage = {
  set: (key, value) => {
		uni.setStorageSync(key, JSON.stringify(value))
  },
  get: (key) => {
    const value = uni.getStorageSync(key)
    return value ? JSON.parse(value) : null
  },
  remove: (key) => {
    uni.removeStorageSync(key)
  },
  clear: () => {
    uni.clearStorageSync()

  },
}

const STORAGE_KEY = Object.freeze({
  TOKEN: 'TOKEN',
  CURRENT_USER: 'CURRENT_USER',
})

export { storage, STORAGE_KEY }

